<!--/**
* 举报*
*
* @author LWG
* @date 2022/9/20 15:10
* @since 1.0.0
*/-->
<template>
    <div>
      <van-nav-bar
        title="举报"
        left-text="返回"
        @click-left="onClickLeft"
        left-arrow
        style="margin-bottom: 6px"
      />
      <van-form @submit="onSubmit" style="padding-right: 6px">
        <!-- <van-cell-group>
          <van-field v-model="value" label="标题" placeholder="请输入标题" />
        </van-cell-group> -->
        <van-field
          v-model="message"
          rows="1"
          autosize
          label="举报理由"
          type="textarea"
          placeholder="请输入举报理由"
        />
        <van-field
          readonly
          clickable
          name="picker"
          :value="selectValue"
          label="所属专题"
          placeholder="点击选择专题"
          @click="showPicker = true"
        />
        <van-popup
          v-model="showPicker"
          position="bottom"
          style="border-radius: 15px 15px 0 0"
        >
          <van-picker
            show-toolbar
            :columns="columns"
            @confirm="onConfirm"
            @cancel="showPicker = false"
          />
        </van-popup>
        <van-field name="uploader" label="证据截图">
          <template #input>
            <van-uploader v-model="uploader" />
          </template>
        </van-field>
        <div style="margin: 16px">
          <van-button round block type="info" native-type="submit" @click="report"
            >举报</van-button
          >
        </div>
      </van-form>
    </div>
  </template>
  
  <script>
  import { Toast } from "vant";
  
  export default {
    name: "PostShare",
    data() {
      return {
        value: "",
        message: "",
        uploader: [],
        selectValue: "",
        columns: ["分享", "求助"],
        showPicker: false,
      };
    },
    methods: {
      report(){
        Toast("举报成功")
        history.go(-1)
      },
      onClickLeft() {
        Toast("返回");
        history.go(-1)
      },
      onSubmit(values) {
        console.log("submit", values);
      },
      onConfirm(selectValue) {
        this.selectValue = selectValue;
        this.showPicker = false;
      },
    },
  };
  </script>
  
  <style scoped>
  </style>